package com.suning.sawp.constants;

/*
 * Copyright (C), 2002-2014, 苏宁易购电子商务有限公司
 * FileName: SMSErrCodeConstants.java
 * Author:   13071604
 * Date:     2014-7-29 下午2:41:09
 * Description: //模块目的、功能描述      
 * History: //修改记录
 * <author>      <time>      <version>    <desc>
 * 修改人姓名             修改时间            版本号                  描述
 */
import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;

/**
 * 〈一句话功能简述〉<br>
 * 〈功能详细描述〉
 * 
 * @author 13071604
 * @see [相关类/方法]（可选）
 * @since [产品/模块版本] （可选）
 */
public class SMSErrCodeConstants {
    public static final String FAILURE = "0";
    public static final String SUCCESS = "1";

    // 脚本批量生成
    public static final String CODE_1001 = "1001";
    public static final String CODE_1002 = "1002";
    public static final String CODE_1003 = "1003";
    public static final String CODE_1101 = "1101";
    public static final String CODE_1102 = "1102";
    public static final String CODE_1103 = "1103";
    public static final String CODE_1104 = "1104";
    public static final String CODE_1105 = "1105";
    public static final String CODE_1106 = "1106";
    public static final String CODE_1107 = "1107";
    public static final String CODE_1108 = "1108";
    public static final String CODE_1109 = "1109";
    public static final String CODE_1110 = "1110";
    public static final String CODE_1111 = "1111";
    public static final String CODE_1112 = "1112";
    public static final String CODE_1113 = "1113";
    public static final String CODE_1114 = "1114";
    public static final String CODE_1115 = "1115";
    public static final String CODE_1116 = "1116";
    public static final String CODE_1117 = "1117";
    public static final String CODE_10001 = "10001";
    public static final String CODE_10002 = "10002";
    public static final String CODE_10003 = "10003";
    public static final String CODE_10004 = "10004";
    public static final String CODE_10005 = "10005";
    public static final String CODE_10006 = "10006";
    public static final Map<String, String> ERROR_MSG_MAPPING = new HashMap<String, String>() {
        private static final long serialVersionUID = -1299431555757561464L;
        {
            put(CODE_1001, "生成短信或者邮件验证码成功(约束判断通过）");
            put(CODE_1002, "验证短信或者邮件验证码成功");
            put(CODE_1003, "图片校验码重置生成条件时图片验证码校验成功");
            put(CODE_1101, "短信或者邮件验证码校验失败");
            put(CODE_1102, "图片验证码校验失败");
            put(CODE_1103, "验证短信验证码或者邮件验证码时达到最大容错次数限制");
            put(CODE_1104, "发送短信验证码失败");
            put(CODE_1105, "根据模板号获取模板信息为空");
            put(CODE_1106, "客户端生成短信或者邮件验证码请求失败");
            put(CODE_1107, "客户端校验短信或者邮件验证码请求失败");
            put(CODE_1108, "客户端验证图片验证码请求失败");
            put(CODE_1109, "客户端生成短信或者邮件验证码key验证失败");
            put(CODE_1110, "客户端校验短信或者邮件验证码key验证失败");
            put(CODE_1111, "客户端校验图片验证码key验证失败");
            put(CODE_1112, "手机号或者邮箱为空");
            put(CODE_1113, "IP地址为空");
            put(CODE_1114, "会员账号信息为空");
            put(CODE_1115, "发送邮件验证码失败");
            put(CODE_1116, "查询短信或者邮件内容中的序号值失败");
            put(CODE_1117, "查询短信或者邮件内容中的序号值成功");
            put(CODE_10001, "该手机号今天无法再获取验证码");
            put(CODE_10002, "请尝试一分钟后获取验证码");
            put(CODE_10003, "用户注册次数过多");
            put(CODE_10004, "一分钟只能获取一次验证码，请耐心等待");
            put(CODE_10005, "一小时只能获取五次验证码，请稍后再试");
            put(CODE_10006, "今天你获取验证码次数过多，请明天再试");
        }
    };

    public static String getValue(String code) {
        String msg = SMSErrCodeConstants.ERROR_MSG_MAPPING.get(code);
        if (StringUtils.isBlank(msg)) {
            return "获取短信信息异常";
        }
        return msg;
    }

}
